import request from '@/utils/request'

// 创建对局信息
export function createRecord(data) {
  return request({
    url: '/game/record/create',
    method: 'post',
    data: data
  })
}

// 更新对局信息
export function updateRecord(data) {
  return request({
    url: '/game/record/update',
    method: 'put',
    data: data
  })
}

// 删除对局信息
export function deleteRecord(id) {
  return request({
    url: '/game/record/delete?id=' + id,
    method: 'delete'
  })
}

// 获得对局信息
export function getRecord(id) {
  return request({
    url: '/game/record/get?id=' + id,
    method: 'get'
  })
}

// 获得对局信息分页
export function getRecordPage(query) {
  return request({
    url: '/game/record/page',
    method: 'get',
    params: query
  })
}

// 获得对局信息分页
export function getRecordPage2(query) {
  return request({
    url: '/game/record/page2',
    method: 'get',
    params: query
  })
}

// 导出对局信息 Excel
export function exportRecordExcel(query) {
  return request({
    url: '/game/record/export-excel',
    method: 'get',
    params: query,
    responseType: 'blob'
  })
}
